package com.mfcxy.service;

import java.io.IOException;
import java.util.Map;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.mfcxy.entity.Blog;
import com.mfcxy.exception.CustomException;

/**
 * 
 * @author mfcxy
 *
 */
public interface IBlogSerivce extends IBaseService{
	/**
	 * 新增文章
	 * @param blog
	 * @return
	 * @throws CustomException 
	 * @throws JsonProcessingException 
	 */
	public int save(Blog blog) throws JsonProcessingException, CustomException;
	
	
	/**
	 * 查询列表
	 * @param p
	 * @param isshow 是否显示
	 * @param isdel 是否伪删除
	 * @return
	 * @throws IOException 
	 * @throws JsonMappingException 
	 * @throws JsonParseException 
	 */
	public Map<String, Object> selectlist(int p) throws JsonParseException, JsonMappingException, IOException;
	

	/**
	 * 根据id查询正文
	 * @param id
	 * @return
	 */
	public Blog getById(int id);
	
	/**
	 * 查询列表 (有评论总数）
	 * @param p
	 * @return
	 * @throws IOException 
	 * @throws JsonMappingException 
	 * @throws JsonParseException 
	 */
	public Map<String, Object> selectlistNum(int p) throws JsonParseException, JsonMappingException, IOException;
}
